class Solution:
    def maximumUniqueSubarray(self, nums: List[int]) -> int:
        dic = set() # 字典 ~ hashmap
        left = 0 # 窗口左下标
        ans = 0 # 结果
        tmp = 0 # 过程结果
        for i,num in enumerate(nums):
            while num in dic:
                dic.remove(nums[left])
                tmp -= nums[left]
                left += 1
            tmp += num
            dic.add(num)
            ans = max(tmp,ans)
        return ans;


  